import http from '@/utils/http'

const BASE_URL = '/education/class-type'

export interface ClassTypeResp {
  id: string
  name: string
  level: number
  status: boolean
  description: string
}

export interface ClassTypeDetailResp {
  id: string
  name: string
  level: number
  status: number
  description: string
}

export interface ClassTypeQuery extends SortQuery {
  id?: string
  level?: number
  name?: string
  status?: number
}

export interface ClassTypePageQuery extends ClassTypeQuery, PageQuery {

}
/** @desc 查询班级类型列表 */
export function getList(query: ClassTypeQuery) {
  return http.get<ClassTypeResp[]>(`${BASE_URL}/list`, query)
}

/** @desc 查询班级类型详情 */
export function getDetail(id: string) {
  return http.get<ClassTypeDetailResp>(`${BASE_URL}/detail/${id}`)
}

/** @desc 创建班级类型 */
export function create(data: any) {
  return http.post(`${BASE_URL}/create`, data)
}

/** @desc 修改班级类型 */
export function update(data: any, id: string) {
  return http.post(`${BASE_URL}/update/${id}`, data)
}

/** @desc 删除班级类型 */
export function remove(id: string) {
  return http.post(`${BASE_URL}/delete/${id}`)
}
